
import javax.swing.*;
import java.awt.*;

    public class Atmtest extends JFrame {
        private LogonPanel logonPanel=new LogonPanel(this);
        private LoginPanel loginPanel = new LoginPanel(this);
        private MenuPanel menuPanel = new MenuPanel(this);
        private Find find = new Find(this);
        private Get get = new Get(this);
        private Modify modify =new Modify(this);
        private Save save = new Save(this);
        private Log log = new Log(this);
        private Image bgImg = Util.getImage("/img/background.jpg");


        private CardLayout cardLayout = new CardLayout();
        public Atmtest(){
            this.setContentPane(new JPanel(){
                @Override
                protected void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    g.drawImage(bgImg,0,0,1024,768,this);
                }
            });
            this.setLayout(cardLayout);
            this.add("login",loginPanel);
            this.add("menu",menuPanel);
            this.add("logon",logonPanel);
            this.add("find",find);
            this.add("get",get);
            this.add("modify",modify);
            this.add("save",save);
            this.add("log",log);
            this.setSize(1024,768);
            this.setLocationRelativeTo(null);
            this.setDefaultCloseOperation(EXIT_ON_CLOSE);
            this.setVisible(true);
        }
        public void switchPanel(String name){
            cardLayout.show(this.getContentPane(),name);
        }

        public static void main(String[] args) {
            new Atmtest();
        }
    }


